Interface configuration
msgconf [-y] [interface] [cfg0] [cfg1] [cfg2] [cfg3]
Prints or sets configuration of communication interfaces.
Printing the configurations
Command msgconf [interface]
prints the configuration of the given interface. Command msgconf
prints all the interfaces and their configurations in a shorter format.
Setting the configurations
Command msgconf [interface] [cfg0] [cfg1] [cfg2] [cfg3]
sets [interface]
to
given configurations [cfg0]
, [cfg1]
, [cfg2]
and [cfg3]
. If the [cfg1]
- [cfg3]
values are not entered, zeroes are configured (as defaults). If only [cfg0]
is given, it is taken as a single 32-bit number. The special values for these numbers are: 0
- disable the current interface and ?1
- set the given interface to the release-specific default configuration.
[interface]
is a 4-bit number that identifies the communication interface. The numbers assignment is listed in the table below.[cfg0]
,[cfg1]
,[cfg2]
and,[cfg3]
are four 8-bit numbers in the range 0 - 255 that specify the setting of the communication interface. If these four numbers would be merged into one 32-bit number,[cfg0]
would be the LSB, and[cfg3]
would be the MSB.Option
-y
will auto-confirm the changes (otherwise a(y/n) ?
prompt will appear).
Interface IDs
[interface] number | Interface |
---|---|
0 | SWD |
1 | UMSG/UARTCOM |
2 | UMSG2/UARTEXT |
3 | CAN |
4 | CANEXT |
5 | UMSG3 |
6 | UMSG4 |
7 | USB |
8 | NRF24 |
9 | BLUETOOTH |
10 | UDP |
11 | LIN |
11 | LIN2 |
13 | LIN3 |
Interface-specific configuration
This section covers only the most common interfaces and their typical use cases. For greater detail, please refer to siliXcon.
CANx
Description of how to read and set configuration for the CAN Interface ([interface]
number 3 or 4).
[cfg0]
- indirectly sets the speed of the interface. It is a prescaler of the maximum CAN speed - 2 Mbps. Possible values and their meaning is in the table below.
[cfg0] value | Speed |
---|---|
1 | 2 Mbit/s |
2 | 1 Mbit/s - default setting in most releases |
4 | 500 kbit/s |
5 | 400 kbit/s |
8 | 250 kbit/s |
10 | 200 kbit/s |
16 | 125 kbit/s |
20 | 100 kbit/s |
[cfg1]
- configures the CAN timing. The value0
is default and other values are reserved for further definition.[cfg2]
- configures the(n)
bits used for the transmitter address in the CAN ID for unicast and multicast messages. If this value is set to0
, a default value ofn = 3
is used. Other values are reserved for further definition.[cfg3]
- reserved for further definition.
UARTx
[cfg0]
- sets baud-rate of selected UART interface in the following way:
[cfg0] value | Baud rate |
---|---|
8 | 1200 bps |
9 | 2400 bps |
10 | 4800 bps |
11 | 9600 bps |
12 | 19200 bps |
13 | 38400 bps |
14 | 57600 bps |
15 | 115200 bps |
16 | 230400 bps |
17 | 460800 bps |
18 | 921600 bps |
[cfg1]
,[cfg2]
and[cfg3]
- configure the UART mode and timings. The default values are0
which denotes the8
bits, no parity, and1
stop bit. Other values are reserved for further definition.
Return value
When called with arguments, returns the current or set value of that interface. When called without arguments returns 0
.
Examples
Command | Description |
---|---|
msgconf 3 8 0 4 6 | sets speed od first CAN interface to 250 kbit/s with default timing, uses 4 bits for transmitter address in CAN 2.0a and 6 bits for transmitter address in CAN 2.0b |
msgconf 3 -1 | sets the first CAN interface to release-specific default configuration |
msgconf 3 0 | disables the first CAN interface |
msgconf 3 4 | sets the speed of the first CAN interface to 500 kbit/s (other configuration remains default) |
msgconf 1 15 0 0 0 | sets UART COM to baud rate 115200 bps, 8 bits, no parity, and 1 stop bit (115200 kbps is the default setting in most releases). Zeroes at the end could be omitted, command msgconf 1 15 has the same effect |
msginit <interface> <cfg0> [cfg1] [cfg2] [cfg3] [-y]
Works similarly to msgconf
(for more info look above), but only for setting the configuration. The only difference is that msginit
DOES NOT save the changes to flash memory. This means that the changes you make with msginit
will be lost after reboot.
msghost [-e/-d] <dest> <interface>
Changes the host address to <dest>
and specifies over what interface will the communication take place. In other words, redirects the communication with the host (for example SWTools) to the specified address over the specified interface.
<dest>
- address of the target device. It is a number in range0 - 255
.<interface>
- number of the used interface. For more info on which number represents which interface, look at the Interface IDs table.
With options -e
(short for enable) / -d
(short for disable), you can disable/enable the stream output from the controller to the host. The controller will save the unsent data to a buffer (buffer has limited storage), and send it after the stream output is enabled again (with -e
). When not specified the option stays as is.
Return value
Returns 0
if and only if the command was successfully executed.
protoconf [-y] [interface] [conf]
Command for viewing and changing service protocols for interfaces.
-y
option, if present no confirmation prompt is displayed.[interface]
interface number according to Interface IDs table.[conf]
a number representing what services to enable and what to disable. A negative value means default configuration, otherwise, each bit in the number represents one service protocol,1
for enable and0
for disable. Look at the table below to see the bit assignment.
The command can be run with 0
arguments, 1
argument, and 2
arguments. When run without arguments, lists all interfaces along with their configurations. If run with only one argument, prints configuration for given [interface]
or if the argument is -1
then sets all interfaces to the default configuration. If run with all arguments enables and disables service protocols for a given interface.
Protocols number assignment
Bit position | Service protocol |
---|---|
0 | PWR (power) - controls device power state. |
1 | FWR (forward) - forwards messages from one interface to another. |
3 | ID (identification) - transfers device metadata (HWID, SWID, UUID ...). |
4 | FS (filesystem) - filesystem transfer, used by emGUI. |
5 | RPC (remote procedure call) - executing commands in the controller, used by emGUI. |
6 | STREAM - default standard input/output streaming, used by Terminal emulator. |
Return value
When called with arguments, returns the current/set value of the given service protocol.
Examples
AM-felix#>protoconf
<outputs 15 lines>
Prints configuration for each interface.
AM-felix#>protoconf -1
reset all protos to default (-1)
(y/n) ?
y
AM-felix#>
Sets all interfaces to default configurations.
AM-felix#>protoconf 3 0b11110111
configuring proto 3 as 247 (247)
(y/n) ?
y
AM-felix#>
Enables all service protocols except for ID service for interface number 3
(CAN).